#include <iterator>
#include <vector>
#include <array>
#include <iostream>
#include "traits.hpp"

template <typename Iter>
typename std::enable_if<impl::is_iterator<Iter>::value>::type foo(Iter a,
                                                                  Iter b)
{
    for (; a != b; ++a)
    {
        std::cout << *a << ",";
    }
    std::cout << '\n';
}

int main(int argc, char** argv)
{
    std::vector<int> vi{1, 2, 3, 4, 5};
    std::array<int, 1> ai{1};
    int arr[10] = {1, 2, 3, 4, 5};
    int *p = nullptr, *q = nullptr;
    foo(vi.begin(), vi.end());
    foo(ai.begin(), ai.end());
    foo(arr, arr + 1);
    foo(p, q);
    return 0;
}